#ifndef __macro_H
#define __macro_H

#ifdef __cplusplus
extern "C"
{
#endif

#define SET_BIT(data, i)            ((data) |= (1 << i))
#define CLR_BIT(data, i)            ((data) &= ~(1 << i))
#define FLP_BIT(data, i)            ((data) ^= (1 << i))
#define GET_BIT(data, i)            ((data) >> (i) & 1)
#define MAX(x, y)                   ((x)>(y)?(x):(y))
#define MIN(x, y)                   ((x)<(y)?(x):(y))
#define ABS(x)                      (((x)>0)?(x):(0-(x)))

#ifdef __cplusplus
}
#endif

#endif